package com.example.auth.api.controller;

import com.example.tools.security.component.UserDTO;
import com.example.tools.security.holder.LoginUserHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: yang
 * @Date: 2021/8/22 0022 14:45
 * @Version 0.0.1
 */
@RestController
@RequestMapping("/user")
public class UserController{

    @Autowired
    private LoginUserHolder loginUserHolderService;

    @GetMapping("/currentUser")
    public UserDTO currentUser() {
        return loginUserHolderService.getCurrentUser();
    }

}